Skip to content

Conversation

@MakD
Copy link
Owner

@MakD MakD commented Feb 7, 2026

No description provided.

MakD added 19 commits February 4, 2026 10:47
This commit adds the `androidx.compose.material:material-icons-extended` dependency to the project. This provides access to a wider range of icons for use in the app's user interface.
This commit introduces a comprehensive integration with Audiobookshelf, allowing users to connect their Audiobookshelf server, browse libraries, and play audiobooks and podcasts directly within the app.

This feature establishes a complete end-to-end experience, from authentication to playback, managed within the user's existing Jellyfin session context.

### Key Additions & Changes:

*   **Authentication & Configuration**:
    *   A new login flow (`AudiobookshelfLoginScreen`) allows users to connect to their Audiobookshelf server.
    *   Authentication details and server configuration are securely stored per Jellyfin user profile using `SecurePreferencesRepository` and `AudiobookshelfConfigEntity`.
    *   The `SessionManager` now links Audiobookshelf sessions to the active Jellyfin session.

*   **API & Data Layer**:
    *   Added `AudiobookshelfApiService` with Retrofit for all network requests to the Audiobookshelf server.
    *   A new `AudiobookshelfRepository` manages data fetching, caching, and state for libraries, items, and progress.
    *   Introduced Room DAO (`AudiobookshelfDao`) and entities (`AudiobookshelfLibraryEntity`, `AudiobookshelfItemEntity`, `AudiobookshelfProgressEntity`) to cache data locally.
    *   New serializable data models for all Audiobookshelf API responses have been created.

*   **UI & Navigation**:
    *   **Settings**: A new entry in the main settings screen to manage the Audiobookshelf connection.
    *   **Main Navigation**: Added a new "Audiobooks" destination to the bottom navigation bar, which becomes visible upon successful authentication.
    *   **Libraries Screen**: A new screen (`AudiobookshelfLibrariesScreen`) to display a user's libraries and a "Continue Listening" section.
    *   **Library View**: A dedicated screen (`AudiobookshelfLibraryScreen`) to browse and search items within a specific library, with distinct layouts for audiobooks (grid) and podcasts (list).
    *   **Item Details**: A detail screen (`AudiobookshelfItemScreen`) shows comprehensive information about a selected audiobook or podcast, including metadata, description, and chapter/episode lists.

*   **Playback System**:
    *   **Player Screen**: A new, dedicated player UI (`AudiobookshelfPlayerScreen`) for audio playback, featuring controls for play/pause, seeking, skipping, chapters, playback speed, and a sleep timer.
    *   **Mini Player**: A persistent mini-player appears at the bottom of the app for navigating while listening.
    *   **Playback Engine**: Implemented `AudiobookshelfPlayer` using ExoPlayer to handle media playback from Audiobookshelf sessions. It also correctly handles token-based authentication for media streams.
    *   **Progress Syncing**: `AudiobookshelfProgressSyncer` is introduced to periodically sync playback progress back to the Audiobookshelf server, ensuring continuity across devices.
    *   **Session Management**: The player gracefully handles pausing/stopping Jellyfin video playback if audio playback is initiated, and vice-versa.
    *   **Background Playback**: An `AudiobookshelfPlayerService` and `MediaSession` integration enable background audio playback and notification controls.
This commit replaces a `Column` with a `Box` in the main navigation layout. This ensures that the `NavHost` content and the `MiniPlayer` can correctly overlap.

By aligning the `MiniPlayer` to the bottom of the `Box`, it now properly displays as an overlay on top of other screens, rather than pushing the main content area up. The `weight` modifier on the `NavHost` was removed as it is no longer necessary within a `Box`.
This commit replaces the standard Material `TopAppBar` in the Audiobookshelf libraries screen with the custom `AfinityTopAppBar`.

This change provides a consistent look and feel with other parts of the app, featuring a bolded title and icons for navigation to Search and Settings. The previous "Back" button has been removed, and the `PullToRefreshBox` has been simplified to a standard `Box`, as the refresh functionality was no longer implemented.

### Key Changes:

*   **`AudiobookshelfLibrariesScreen.kt`**:
    *   Replaced `TopAppBar` with the `AfinityTopAppBar` composable.
    *   Removed the `PullToRefreshBox` wrapper.
    *   Updated the screen to accept `NavController` and `MainUiState` to handle top bar actions and display the user's profile image.
*   **`MainNavigation.kt`**:
    *   Updated the call to `AudiobookshelfLibrariesScreen` to pass the required `navController` and `mainUiState` parameters.
    *   Removed the now-unused `onNavigateBack` lambda.
This commit redesigns the Audiobookshelf libraries screen, replacing the previous list-based layout with a modern, tab-based interface. This provides a more organized and discoverable user experience.

The new layout features dynamic tabs for "Home", "Series", and each individual library, allowing users to quickly pivot between different views of their content.

### Key Changes:

*   **Tabbed Navigation**:
    *   Implemented `HorizontalPager` with filter chips for navigating between "Home", "Series", and library-specific tabs.
    *   Items for each library are now loaded on-demand as the user selects the corresponding tab.

*   **New "Home" Tab**:
    *   Introduced `AudiobookshelfHomeTab.kt` to display personalized sections from the server, such as "Continue Listening" or "Recently Added".
    *   These sections are aggregated from all available libraries into a single, unified view.

*   **New "Series" Tab**:
    *   Added `AudiobookshelfSeriesTab.kt` to group books by series.
    *   Series from all libraries are fetched and displayed in a single, sorted list, each with a horizontally scrolling row of its books.

*   **ViewModel and Repository**:
    *   `AudiobookshelfLibrariesViewModel` now fetches and manages state for personalized sections, series, and per-library item lists.
    *   `AudiobookshelfRepository` and `AudiobookshelfApiService` were updated to include methods for fetching personalized content and series data.

*   **UI/UX Improvements**:
    *   Redesigned the `AudiobookCard` for a cleaner look with improved typography and elevation.
    *   Replaced the old "headphones" icon for the Audiobookshelf navigation entry with a new "books" icon for better representation.
…cape layout

This commit completely redesigns the item details screen (for both audiobooks and podcasts) to create a more modern and immersive user experience.

The most significant change is the introduction of a "hero" header, which displays a full-width, blurred version of the cover art at the top of the screen, overlaid with a gradient. The main content, including the cover image, title, author, and play button, is now presented over this hero background, creating a more visually engaging layout.

The screen now also supports a landscape orientation, providing a split-view layout with item details on one side and the chapter/episode list on the other for better use of space on wider screens.

### Key Changes:

*   **`ItemHeader.kt`**:
    *   Rebuilt from the ground up to feature a blurred hero background (`ItemHeroBackground`).
    *   Redesigned the main content area (`ItemHeaderContent`) with improved typography, spacing, and a more prominent, stylized "Play" button.
    *   The book/podcast description is now a collapsible `ExpandableSynopsis` that supports "Show More"/"Show Less" functionality and renders basic HTML content.
    *   Playback progress is now shown with a circular indicator and "time left" text instead of a linear progress bar.

*   **`ChapterList.kt` & `EpisodeList.kt`**:
    *   List items are now styled with rounded corners and background colors for the current item, improving clarity.
    *   Visual refresh of icons, typography, and spacing for a cleaner look.
    *   Removed dividers in favor of spacing between items.

*   **`AudiobookshelfItemScreen.kt`**:
    *   Implemented a landscape layout that shows item details and the chapter/episode list side-by-side.
    *   Removed the `TopAppBar`, replacing it with a floating, semi-transparent back button for a cleaner, full-screen look.
    *   The main content area is now a `LazyColumn` for better performance with long chapter or episode lists.
This commit enhances the item details screen for audiobooks by adding the narrator's name to the header section.

It also slightly adjusts the author's name display by prepending it with "by " for better clarity.

### Key Changes:

*   **`ItemHeader.kt`**:
    *   Added a new `Text` component to display "Narrated by: [Narrator Name]" when the narrator information is available.
    *   `buildAnnotatedString` is used to style "Narrated by: " differently from the narrator's name itself.
    *   The author's name is now prefixed with "by " (e.g., "by John Doe").
This commit introduces background playback for audiobooks using a `MediaSessionService`, allowing playback to continue when the app is not in the foreground. It also adds media notifications with playback controls.

To support this, the app now requests the `POST_NOTIFICATIONS` permission on Android 13 (TIRAMISU) and higher to display the media controls. A `WAKE_LOCK` permission has also been added to ensure uninterrupted playback.

### Key Changes:

*   **`AudiobookshelfPlayerService`**: A new `MediaSessionService` that manages the `ExoPlayer` instance and integrates with the Android media system.
*   **Media Notifications**: The service displays a media style notification with playback controls (play/pause, etc.) and artwork.
*   **Permission Handling**:
    *   `MainActivity` now requests the `POST_NOTIFICATIONS` permission on startup for Android 13+.
    *   The `WAKE_LOCK` permission was added to `AndroidManifest.xml`.
*   **`AudiobookshelfPlayer`**:
    *   Now starts `AudiobookshelfPlayerService` upon initialization.
    *   `ExoPlayer` is configured with `WAKE_MODE_NETWORK` to maintain network connectivity during playback.
    *   Media metadata (title, author, artwork) is now passed to `ExoPlayer` to be displayed in the media notification.
*   **Lifecycle Management**: Improved player and service lifecycle handling to prevent crashes and ensure resources are released correctly.
…rvice

This commit introduces a complete visual and architectural overhaul of the Audiobookshelf player. The player screen now features a modern, media-centric design with dynamic background colors based on cover art. It also refactors the playback logic to use a `MediaSessionService` for more robust background audio handling and system integration.

### Key Changes:

*   **feat(player): Redesigned Player UI**
    *   The player screen (`AudiobookshelfPlayerScreen.kt`) is fully redesigned with a dynamic, blurred background that adapts to the dominant color of the audiobook cover.
    *   A new layout is implemented for both portrait and landscape orientations.
    *   The playback controls, sleep timer, playback speed, and chapter selection dialogs have been restyled for a more modern and intuitive user experience.

*   **refactor(player): Implement `MediaSessionService`**
    *   Playback is now managed by `AudiobookshelfPlayerService`, a `MediaSessionService`, instead of being directly controlled within the `AudiobookshelfPlayer` class.
    *   This change improves background playback stability, enables system media integrations (like lock screen controls), and follows Android best practices.
    *   `AudiobookshelfPlayer` now acts as a controller, delegating playback commands to the service via `MediaController`.

*   **chore: Replace Material Icons with custom vector drawables**
    *   Removed the `material-icons-extended` dependency.
    *   Added a set of custom vector drawable icons to replace the previously used Material Icons, reducing dependency overhead and providing a more consistent visual style.

*   **build: Add `androidx.palette` dependency**
    *   The `androidx.palette:palette-ktx` library was added to enable the extraction of dominant colors from cover art for the new dynamic UI.
This commit introduces a set of new icons and updates existing ones to improve the user interface for the Audiobookshelf integration. The changes provide more specific and visually distinct icons for different media types and actions.

### Key Changes:

*   **New Icons Added**:
    *   `ic_audiobookshelf_light`: A light version of the Audiobookshelf server icon.
    *   `ic_book_audio`: Icon for audiobooks.
    *   `ic_book_series`: Icon for book series.
    *   `ic_collection`: Icon for collections.

*   **Icon Updates**:
    *   **Audiobookshelf Libraries**: The navigation chips now use more specific icons.
        *   "Home" is now `ic_book_series`.
        *   "Series" is now `ic_collection`.
        *   Library items now dynamically use `ic_book_audio` for books and `ic_apple_podcast` for podcasts.
    *   **Chapter Selector**: The "currently playing" indicator icon has been changed from `ic_speed` to the more intuitive `ic_player_play_filled`.
    *   **Output Icon**: The `ic_arrows_output.xml` drawable has been visually updated.
This commit introduces detailed logging for Audiobookshelf playback sessions to aid in debugging and improve reliability. It captures information at various stages of the playback process, from session creation to server responses.

Additionally, this change enhances support for podcasts by constructing a playlist from all episodes when a podcast series is played, rather than just a single episode.

### Key Changes:

*   **`AudiobookshelfRepositoryImpl.kt`**: Added detailed logging for playback session responses, including session details on success and error bodies on failure.
*   **`NetworkModule.kt`**: Implemented an OkHttp interceptor to log the full response body for playback-related network requests (`/play` endpoint).
*   **`AudiobookshelfPlayer.kt`**:
    *   Enhanced logging when closing a playback session to distinguish between local and server-side actions.
    *   Implemented logic to build a media playlist from all episodes when playing a podcast series from the library view.
*   **`AudiobookshelfApiService.kt`**: Corrected the return type for the `syncPlaybackSession` API call from `Response<SyncResponse>` to `Response<Unit>`, as the endpoint does not return a body.
This commit fixes an issue where only the first page of results was being fetched from Audiobookshelf libraries. The `getLibraryItems` and `getSeries` methods have been updated to loop through all available pages, ensuring that all items and series are retrieved and displayed.

### Key Changes:

*   **`AudiobookshelfRepositoryImpl.kt`**:
    *   Modified `refreshLibraryItems` to repeatedly call the API until all paginated items for a library are fetched.
    *   Updated `getSeriesForLibrary` to similarly fetch all pages of series results.
    *   When refreshing library items, the local database is now cleared only once before the first page is fetched, preventing data loss during the pagination process.
…p update

This commit introduces two changes to the Audiobookshelf integration.

First, it updates the API call for fetching library items to sort the results alphabetically by the media's title (`media.metadata.title`). This ensures a consistent and predictable order for items displayed within a library.

Second, it simplifies the code in the `AudiobookshelfLibrariesViewModel` by using the `plusAssign` (`+=`) operator to update the `_libraryItems` map, which is a minor code cleanup.

### Key Changes:

*   **`AudiobookshelfRepositoryImpl.kt`**:
    *   Added `sort = "media.metadata.title"` to the `getLibraryItems` API call parameters.
*   **`AudiobookshelfLibrariesViewModel.kt`**:
    *   Changed `_libraryItems.value = _libraryItems.value + (libraryId to items)` to the more concise `_libraryItems.value += (libraryId to items)`.
…k Settings

This commit updates several icons throughout the application to improve visual consistency and branding.

The previous monochrome icon for Overseerr/Jellyseerr has been replaced with the official, full-color logo. The Audiobookshelf icon has also been updated. Additionally, the stroke width of the playback settings icon has been increased for better visibility.

### Key Changes:

*   **`ic_request_seerr_dark.xml`**: Deleted the old monochrome icon.
*   **`ic_seerr_logo.xml`**: Added the new, official color logo for Overseerr/Jellyseerr.
*   **`SettingsScreen.kt`**: Updated `SettingsSwitchItem` and dialogs for media requests (Jellyseerr) and Audiobookshelf to use the new icons.
*   **`ic_playback_settings.xml`**: Increased the `strokeWidth` from `1.5` to `1.7` for improved clarity.
This commit introduces the `ktfmt` Gradle plugin to enforce a consistent code style across the project.

The plugin is applied to all subprojects and configured to use the `kotlinLangStyle()`, which is a ktfmt-compatible code style used by official Kotlin libraries. This helps maintain code quality and readability.
This commit applies code formatting changes across multiple files, primarily focused on adding trailing commas to parameter lists in Kotlin files. This improves code style consistency and makes future diffs cleaner.

No functional changes are introduced in this commit.
This commit refactors the Audiobookshelf integration by replacing the dedicated login screen with a more streamlined `ModalBottomSheet`. It also introduces several new features, including dedicated screens for viewing book series and browsing items by genre, enhancing content discovery.

### Key Changes:

*   **Login Flow**:
    *   Replaced the full-screen `AudiobookshelfLoginScreen` with a new `AudiobookshelfBottomSheet` accessible directly from the Settings screen. This simplifies the user flow and integrates Audiobookshelf setup more cleanly into the app's settings.
    *   Added a notification permission prompt after a successful login to ensure media controls are visible.

*   **Series Screen (`AudiobookshelfSeriesScreen.kt`)**:
    *   Introduced a new screen to display all books within a specific series.
    *   The screen features a composite cover image generated from the first four books and lists all items in the series, adapting its layout for both portrait and landscape orientations.

*   **Genre Screens (`AudiobookshelfGenreResultsScreen.kt`)**:
    *   Added a new screen to show all audiobooks and podcasts belonging to a specific genre.
    *   Users can filter results between "Audiobooks" and "Podcasts" using a segmented control.
    *   The Search screen now displays a grid of genres for quick exploration.

*   **Search and Discovery**:
    *   Audiobookshelf content is now included in the main search results when "All" is selected.
    *   Added a dedicated "Audiobooks" filter chip to the search screen for targeted searches within Audiobookshelf libraries.
    *   The item details screen now displays a "Included in Series" section, allowing users to navigate directly to the new series screen.

*   **Player & Session Management**:
    *   The Audiobookshelf player session is now automatically closed when the user logs out or switches to a Jellyfin server, preventing playback conflicts.
    *   Added support for starting playback from a specific position (e.g., when clicking a chapter).

*   **UI/UX Improvements**:
    *   Redesigned the mini player for a more modern and compact look.
    *   Improved the item details screen layout, with a larger cover image, collapsible sections for chapters/episodes, and a refined header.
    *   The `windowSoftInputMode` is set to `adjustResize` to prevent the keyboard from overlapping UI elements, like the login bottom sheet.
This commit removes the explicit back button from the `AudiobookshelfItemScreen` and `AudiobookshelfSeriesScreen`.

The functionality was redundant, as the system back gesture and the back button in the top app bar already provide this navigation. Removing the custom button simplifies the UI and relies on standard navigation patterns.

### Key Changes:

*   **`AudiobookshelfItemScreen.kt` & `AudiobookshelfSeriesScreen.kt`**:
    *   Removed the `IconButton` that served as a back button from the top-left corner.
    *   Deleted the `onNavigateBack` lambda parameter from the function signatures as it's no longer needed.
    *   In `AudiobookshelfSeriesScreen`, added a `Spacer` to adjust the layout after the button's removal.
*   **`MainNavigation.kt`**:
    *   Updated the calls to `AudiobookshelfItemScreen` and `AudiobookshelfSeriesScreen` to remove the `onNavigateBack` argument, aligning with the updated composable signatures.
This commit introduces genre-based sections to the Audiobookshelf home screen, providing users with another way to discover content.

Up to 15 random genres are selected and displayed as new shelves. Each shelf is populated with up to 15 items from that genre, fetched from all available libraries.

This also includes a version bump to `0.6.0-beta`.

### Key Changes:

*   **`AudiobookshelfLibrariesViewModel.kt`**:
    *   Added new logic to fetch all available genres.
    *   Selects a random subset of genres to display.
    *   Fetches items for each selected genre across all libraries and populates new `PersonalizedSection` objects.
    *   These genre sections are combined with the existing personalized sections on the home screen.

*   **`AudiobookshelfRepository.kt` & `AudiobookshelfRepositoryImpl.kt`**:
    *   Introduced `getGenreItemsLimited`, a new function to fetch a limited number of library items for a specific genre.

*   **UI & Other**:
    *   In `SettingsScreen` and `RequestsScreen`, the Jellyseerr bottom sheet is now configured with `skipPartiallyExpanded = true` to prevent it from stopping in a partially open state.
    *   Simplified the notification permission request logic in `AudiobookshelfBottomSheet.kt` by removing an unnecessary Android version check.
    *   Bumped app version to `0.6.0-beta` (`versionCode` 36).
@MakD MakD merged commit 7bb1479 into master Feb 7, 2026
1 check passed
@MakD MakD deleted the audiobookshelf-support branch February 7, 2026 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant